import { createRouter, createWebHistory } from 'vue-router'


//路由的跳转地址 path name
const routes = [
    {
        path: '/',
        home: 'home',
        component: () => import('@/views/Home.vue'),
        meta: { title: '首页', icon:'House',show:true ,useFrame:false}
    },
    {
        path: '/moveshow',
        name: 'moveshow',
        component: () => import('@/views/MoveShow.vue'),
        meta: { title: '移动展示页', icon:'Files',show:false,useFrame:true}
    },
    {
        path: '/moveCategory',
        name: 'moveCategory',
        component: () => import('@/views/MoveCategory.vue'),
        meta: { title: '移动分类', icon: 'Files', show: false, useFrame: true }
    },
    {
        path: '/moveProductList',
        name: 'moveProductList',
        component: () => import('@/views/MoveProductList.vue'),
        meta: { title: '移动分类', icon: 'Files', show: false, useFrame: true }
    },
    {
        path: '/category',
        component: () => import('@/views/category/Index.vue'),
        meta: { title: '类目管理', icon:'Operation' ,show:true},
        children: [
            {
                path: '/category/list',
                name: 'category-list',
                component: () => import('@/views/category/List.vue'),
                meta: { title: '类目列表', icon: 'List', show: true }
            },
            {
                path: '/category/add',
                name: 'category-add',
                component: () => import('@/views/category/Add.vue'),
                meta: { title: '类目添加', icon: 'Plus', show: true }
            },
            {
                path: '/category/edit',
                name: 'category-edit',
                component: () => import('@/views/category/Edit.vue'),
                meta: { title: '类目修改', icon: 'EditPen', show: false }
            }
        ]
    },
    {
        path: '/product',
        component:()=>import('@/views/product/Index.vue'),
        meta: { title: '商品管理', icon: 'Handbag', show: true },
        children: [
            {
                path: '/product/list',
                name: 'product-list',
                component: () => import('@/views/product/List.vue'),
                meta: { title: '商品列表', icon: 'List', show: true }
            },
            {
                path: '/product/add',
                name: 'product-add',
                component: () => import('@/views/product/Add.vue'),
                meta: { title: '商品添加', icon: 'Plus', show: true }
            },
            {
                path: '/product/edit',
                name: 'product-edit',
                component: () => import('@/views/product/Edit.vue'),
                meta: { title: '商品修改', icon: 'Edit', show: true }
            }
        ]

    }
]

// 创建路由实例对象
const router = createRouter({
    history: createWebHistory(),
    routes
})

export default router
